package com.xiaoshuidi.cloud.module.rooms.framework.config;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

@Component
@Getter
@RefreshScope
public class ConfigValues {

    public static String profilesActive;

    @Value("${rooms.preurl}")
    private String preurl;
    @Value("${rooms.accountsInfoUrl}")
    private String accountsInfoUrl;
    @Value("${rooms.gaodeKey}")
    private String gaodeKey;
    @Value("${rooms.addressToLatitudeAndLongitudeUrl}")
    private String AddressToLatitudeAndLongitudeUrl;
    @Value(("${rooms.adminAreaSearchUrl}"))
    private String adminAreaSearchUrl;
    @Value(("${rooms.getDistance}"))
    private String getDistanceUrl;
    @Value("${nfs-path}")
    private  String nfsPath;
    @Value(("${rooms.reserveNotify}"))
    private String reserveNotify;
    @Value("${rooms.HFMetro}")
    private String HFMetro;
    // 百度应用AK
    @Value("${rooms.baiduAK}")
    private String baiduAK;
    // 百度地理位置编码
    @Value("${rooms.baiduAddressToLonLatUrl}")
    private String baiduAddressToLonLatUrl;
    // 百度逆地理位置编码
    @Value("${rooms.baiduLonLatToAddressUrl}")
    private String baiduLonLatToAddressUrl;
    // 百度地图步行路线规划
    @Value("${rooms.baiduWalkingRoutePlanningUrl}")
    private String baiduWalkingRoutePlanningUrl;
    // 百度-地点输入提示
    @Value("${rooms.locationEntryPrompt}")
    private String locationEntryPrompt;
    // 百度-坐标系转换
    @Value("${rooms.convertCoordinates}")
    private String convertCoordinates;

    /**
     * python通过token获取用户信息地址
     *
     * @return
     */
    public String getAccountsInfoUrl() {
        return preurl + accountsInfoUrl;
    }

    @Value("spring.profiles.active")
    public void setProfilesActive(String profilesActive) {
        ConfigValues.profilesActive = profilesActive;
    }

}
